{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "ba1e8807",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.24.1\n"
     ]
    }
   ],
   "source": [
    "import xlwings as xw\n",
    "\n",
    "print(xw.__version__)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "b94167c4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# https://www.xlwings.org/\n",
    "\n",
    "\"\"\"\n",
    "参数visible用于设置Excel程序窗口的可见性，\n",
    "如果为True，表示显示Excel程序窗口，如果为False，表示隐藏Excel程序窗口；\n",
    "\n",
    "参数add_book用于设置启动Excel程序窗口后是否新建工作簿，\n",
    "如果为True，表示新建一个工作簿，如果为False，表示不新建工作簿。\n",
    "\"\"\"\n",
    "app = xw.App(visible=False, add_book=False)\n",
    "\n",
    "workbook = app.books.add()\n",
    "workbook.save(\"foo.xlsx\")\n",
    "\n",
    "# 关闭文件\n",
    "app.quit()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
